package com.zrrd2._7_20.H3;

import java.io.*;

public class UserServiceImpl implements UserService{

    @Override
    public boolean login(String username, String password) {
        File file=new File("D:/aaa/"+username+".txt");
        if(!file.exists()){

            return false;
        }
        return false;
    }

    @Override
    public boolean register(User user) throws FileNotFoundException {
        String file="D:/aaa/"+user.getUsername()+".txt";
        File f=new File(file);
        if(!f.exists()){
            try {
                f.createNewFile();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }else {
            return false;
        }
        FileOutputStream fos=null;
        fos=new FileOutputStream(file);

        return false;
    }
}
